<%@page import="com.blockchain.console.service.system.entity.SysUser"%>
<%@page import="com.blockchain.console.service.system.SysUserManage"%>
<%@page import="com.blockchain.framework.service.query.Paging"%>
<%@page import="com.blockchain.framework.service.query.PagingResult"%>

<%@page import="com.blockchain.variables.defines.SystemVariable"%>
<%@page import="com.blockchain.console.servlets.Login"%>
<%@page import="com.blockchain.console.service.common.entity.ConsoleMenu"%>
<%@page import="com.blockchain.console.servlets.Logout"%>
<%@page import="com.blockchain.console.servlets.common.UpdatePass"%>
<%@page import="com.blockchain.framework.http.entity.RoleBean"%>
<%@page import="com.blockchain.framework.http.service.RoleManage"%>
<%@page import="com.blockchain.console.config.ConsoleConst"%>
<%@page import="java.util.UUID"%>
<%@page import="java.util.Locale"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.util.Date"%>

<%
	if (blockchainSession == null || !blockchainSession.isAuthenticated()) {
		controller.redirectLogin(request, response, controller.getURI(request, Login.class));
		return;
	}
%>

<div style="width:100%;">
<%{String warning_id=UUID.randomUUID().toString();%>
<div style="position:fixed; background:#fff; z-index:9999;width:100%;height:768px; overflow:hidden; display:block;" id='<%=warning_id%>'>
<div style='padding-top:18%;padding-left:40%;font-size:18px;line-height:30px;color: #c30'>
警告: 如果看到该页面,可能是因为:
<div style="list-style: decimal outside;">
<div><span>1. 您的浏览器没有启用JavaScript功能;</span></div>
</div>
</div>
</div>
<script type="text/javascript">try{document.getElementById('<%=warning_id%>').style.display='none';}catch(e){}</script>
<%}%>

<div class="header_main">
	<div class="logo_bg">
		<a href="<%=controller.getURI(request, com.blockchain.console.servlets.common.Index.class)%>">
			<b class="logo" style="background-size:155px; margin-top:13px;"></b>
		</a>
	</div>
	<div class="welcome fr">
	欢迎您：<span style="color:#5786ca;"><%StringHelper.filterHTML(out, blockchainSession.getAttribute(ConsoleConst.ACCOUNT_NAME));%></span>
	
	<%
	{
		SysUserManage _sm = serviceSession.getService(SysUserManage.class);
		SysUser _su = _sm.get(serviceSession.getSession().getAccountId());
		RoleManage _rm = serviceSession.getService(RoleManage.class);
		PagingResult<RoleBean> _r = _rm.search(null, new Paging() {
			@Override
			public int getSize() {
				return Integer.MAX_VALUE;
			}
		
			@Override
			public int getCurrentPage() {
				return 1;
			}
		});
		if(_r.getItems()!=null){
			for (RoleBean _rb : _r.getItems()) {
				if (_rb == null) {
					continue;
				}
	%>
	<%if (_rb.getRoleId() == _su.roleId) {%><em>职级：<%StringHelper.filterHTML(out, _rb.getName());%></em><% break;}%><!--新加em-->
	<%}}}%>
	
        <a href="<%=controller.getURI(request, UpdatePass.class)%>"><span style="color:#fff;">修改密码 </span></a>| 
         <a href="<%=controller.getURI(request, Logout.class)%>" style="color:#fff;"> 安全退出</a>
    </div>
	<ul class="mainnav clearfix">
		<li class="<%="GL".equals(CURRENT_CATEGORY)?"cur":""%>"><a href="<%=controller.getURI(request, com.blockchain.console.servlets.common.Index.class)%>">概览</a></li>
		<%
		ConsoleMenu[] cms = {
			ConsoleMenu.HHGL(),
			ConsoleMenu.JYGL(),
			ConsoleMenu.CWGL(),
			ConsoleMenu.NRGL(),
			ConsoleMenu.XTGL(), 
			};
		for(ConsoleMenu cm : cms){
		%>
		<%Class<? extends Servlet> clszz=cm.getDefaultMenu(blockchainSession); %><li class="<%=cm.code.equals(CURRENT_CATEGORY)?"cur":""%>" <%if(clszz==null){out.print("style='display:none;'");} %>><a href=<%if(clszz!=null){ %><%=controller.getURI(request, clszz)%><%}else{out.print("#  class='disabled'");} %>><%=cm.name %></a></li>
		<%
		}
		%>
	</ul>
</div>